package com.sx.baseproject.framework.tools.image;

import android.app.Activity;

import com.sx.baseproject.framework.view.dialog.DialogPhotoSelect;

import java.io.File;

public class DialogImageOpt {
    public  static DialogImageOpt dialogImageOpt;
    public static DialogImageOpt getInstance(){
        if(dialogImageOpt==null){
            synchronized (DialogImageOpt.class){
                if(dialogImageOpt==null){
                    dialogImageOpt=new DialogImageOpt();
                }
            }
        }
        return dialogImageOpt;
    }
    public File mFile;
    public  void showOptImage(Activity activity, int cameraReq, int photoReq) {
        new DialogPhotoSelect.Builder(activity)
                .setOnClickSelectListener(new DialogPhotoSelect.OnClickSelectListener() {
                    @Override
                    public void onClickItemTop() {
                        mFile=null;
                        mFile=HWImageManager.getInstance().getBitmapFun().imageOpenCamera(activity,cameraReq);
                    }

                    @Override
                    public void onClickItemBottom() {
                        //相册
                        HWImageManager.getInstance().getBitmapFun().imageOpenPhoto(activity,photoReq);

                    }
                }).show();
    }
}
